#ifndef POINT_H
#define POINT_H
#include "math.h"
#include "iostream"
class Point
{
protected:
    int x, y;

    /* data */
public:
    Point(int ptx, int pty);
    Point(Point &pt);
    int getX() { return x; }
    int getY() { return y; }
    int operator-(Point pt1)
    {
        return sqrt(pow(x - pt1.getX(), 2) + pow(y - pt1.getY(), 2));
    }
    friend ostream& operator <<(ostream& stm,Point pt)
    {
        stm<<"("<<pt.x<<","<<pt.y<<")";
        return stm;
    } 
};

Point::Point(int ptx, int pty)
{
    x = ptx;
    y = pty;
}
Point::Point(Point &pt)
{
    x = pt.x;
    y = pt.y;
}

class Line : private Point
{

    /* data */
public:
    Line(Point pt1, Point pt2) : start(pt1), end(pt2), Point((pt1.getX() + pt2.getX()) / 2, (pt1.getY() + pt2.getY()) / 2)
    {
        length = start - end;
    }
    int getMidPtX() { return x; }
    int getMidPtY() { return y; }
    double getLength() { return length; }

    friend ostream& operator <<(ostream& stm,Line l)
    {
        stm<<l.start;
        std::cout<<endl;
        stm<<l.end;
        std::cout<<endl;
        stm<<l.length;
        std::cout<<endl;
        return stm;
    }
private:
    Point start, end;
    double length;
};
class Circle :public Point
{
private:
    int r;
    Point center;

public:
    Circle(Point centerPt, int r);
    Circle(Circle &inputCircle);
    bool isInner(Point pt)
    {
        return (center - pt) < r;
    }

    friend ostream& operator <<(ostream& stm,Circle circle)
    {
        return stm<<circle.center<<endl<<circle.r;
    }
};

Circle::Circle(Point centerPt, int inputR) : center(centerPt), Point(centerPt)
{
    r = inputR;
}
Circle::Circle(Circle &inputCircle):Point(inputCircle.center),center(inputCircle.center)
{
    r = inputCircle.r;
}
class Cylinder :public Circle
{
private:
    int height;
    Circle circle;
public:
    Cylinder(Circle inputCircle, int height);
    int getHeight(){return height;}
    friend ostream & operator << (ostream& stm,Cylinder cy)
    {
        stm<<cy.circle<<endl;
        stm<<cy.height;
        return stm;
    }
    
};

Cylinder::Cylinder(Circle inputCircle, int inputHeight) :circle(inputCircle),Circle(inputCircle)
{
    height = inputHeight;
}
class Cpheroid :public Circle
{
private:
    /* data */
    Circle circle;
public:
    Cpheroid(Circle circle) ;
    // ~Cpheroid();
      friend ostream & operator << (ostream& stm,Cpheroid cp)
{
     return stm<<cp.circle;
}
};

Cpheroid::Cpheroid(Circle inputCircle) :Circle(circle),circle(inputCircle)
{
}



#endif